import request from '@/utils/request'

// 查询轮播图片列表
export function listSwipper(query) {
  return request({
    url: '/mysystem/swipper/list',
    method: 'get',
    params: query
  })
}

// 查询轮播图片详细
export function getSwipper(swipperId) {
  return request({
    url: '/mysystem/swipper/' + swipperId,
    method: 'get'
  })
}

// 新增轮播图片
export function addSwipper(data) {
  return request({
    url: '/mysystem/swipper',
    method: 'post',
    data: data
  })
}

// 修改轮播图片
export function updateSwipper(data) {
  return request({
    url: '/mysystem/swipper',
    method: 'put',
    data: data
  })
}

export function changeStatus(swipperId, status) {
  const data = {
    swipperId: swipperId,
    status
  }
  return request({
    url: '/mysystem/swipper/changeStatus',
    method: 'put',
    data: data
  })
}

// 删除轮播图片
export function delSwipper(swipperId) {
  return request({
    url: '/mysystem/swipper/' + swipperId,
    method: 'delete'
  })
}
